package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class QueryExpression {

    private int beginIndex;
    private int endIndex;
    private WithClause withClause;
    private QueryExpressionBody queryExpressionBody;

    public QueryExpression(WithClause withClause, QueryExpressionBody queryExpressionBody) {
        if (withClause != null) {
            this.beginIndex = withClause.getBeginIndex();
        } else {
            this.beginIndex = queryExpressionBody.getBeginIndex();
        }
        this.endIndex = queryExpressionBody.getEndIndex();
        this.withClause = withClause;
        this.queryExpressionBody = queryExpressionBody;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public WithClause getWithClause() {
        return withClause;
    }

    public QueryExpressionBody getQueryExpressionBody() {
        return queryExpressionBody;
    }

}
